program prog;

type
   StudentRecord = Record
      s_name: String;
      s_addr: String;
      s_age: integer;
      s_batchcode: String;
   end;
var
   Student: StudentRecord;
   f: file of StudentRecord;

begin
   Assign(f,'c:\temp\students.dat');
   Rewrite(f);
   Student.s_name := 'John Smith';
   Student.s_addr := 'United States of America';
   Student.s_age := 24;
   Student.s_batchcode := 'Computer Science';
   Write(f,Student);
   Close(f);
end.
